// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  ssr: true,
  app: {
    head: {
      title: "Nuxt 3 项目模板",
      charset: "utf-8",
      meta: [
        { name: "description", content: "Nuxt 3 项目模板" },
        // 关键词设置在8个以内。
        { name: "keywords", content: "Nuxt 3 项目模板" },
      ],
      // 设置icon
      link: [{ rel: "icon", href: "/favicon.ico", type: "image/x-icon" }],
    },

    // 设置页面过渡效果
    pageTransition: { name: "page", mode: "out-in" },
    // 设置布局过渡效果
    layoutTransition: { name: "layout", mode: "out-in" },
  },
  modules: [
    "@nuxtjs/i18n",
    "@pinia/nuxt",
    "@pinia-plugin-persistedstate/nuxt",
    "@element-plus/nuxt",
    "@vant/nuxt",
  ],
  // 配置router 与 vue-router 一致
  router: {
    options: {},
  },
  css: ["normalize.css/normalize.css"],
  i18n: {
    // 添加路由前缀的方式
    strategy: "no_prefix",
    //配置语种
    locales: ["zh"],
    // 默认语种
    defaultLocale: "zh",
    // 通过vueI18n配置
    vueI18n: "./locales/index.ts",
  },
  imports: {
    // 自动导入文件夹，无需手动import
    dirs: [
      "store/**",
      "plugins/**",
      "utils/**",
      "composables/**",
      "interface/**",
    ],
  },
  plugins: [],
  compatibilityDate: "2024-04-03",
  devtools: { enabled: true },
});
